#!/usr/bin/env bash

if [ $# -gt 1 ]; then
    echo -e "
Usage:dc-c [keyword]
"
   exit 1
fi

if [ $# = 0 ]; then
    docker ps -a | awk '{print $1}'|  grep -v 'CONTAINER' | xargs docker rm -fv
else # 1 个参数
    docker ps -a | grep $1 | awk '{print $1}'|  grep -v 'CONTAINER' | xargs docker rm -fv
fi

docker volume prune -f
docker network prune -f